/*
 * ARPAParser.h
 *
 *  Created on: Dec 4, 2014
 *      Author: ale
 */

#include <fstream>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <string>
#include <map>
#include <cmath>
#include <boost/foreach.hpp>
#include <boost/tokenizer.hpp>
#include "Predictor.h"
#include "Predictor2.h"
#include "Predictor3.h"

using namespace std;

#ifndef PRED_ARPAPARSER_H_
#define PRED_ARPAPARSER_H_

class ARPAParser {
public:
	ifstream myfile;
	const char* directorio;
	unsigned long int cantUnigramas;
	unsigned long int cantBigramas;
	unsigned long int cantTrigramas;
	ARPAParser(const char* ruta);
	virtual ~ARPAParser();

	bool cargarArchivo();
	bool cargarCantNGramas();
	bool cargarUniGramas(Predictor3*);
	bool cargarBiGramas(Predictor3*);
	bool cargarTriGramas(Predictor3*);

	bool imprimirTrigramasQueComienzanConAB(istream::streampos, string, string, vector<double> *probas, vector<string> *trigramas);
	bool bigramaDistinto(string Aanterior, string Banterior, string trigrama);

	bool imprimirBigramasQueComienzanCon(istream::streampos, string, vector<double> *probas, vector<string> *bigramas);
	bool unigramaAnteriorDistinto(string Aanterior, string trigrama);
};

#endif /* PRED_ARPAPARSER_H_ */
